$(function (){
	var headTitle = document.title;
	var tmpl = '<div class="header-wrap">'
	        		+'<a href="javascript:history.back();" class="header-back"><span>返回</span></a>'
						//+'<h2>'+headTitle+'</h2>'
						+'<a href="javascript:void(0)" id="btn-opera" class="i-main-opera">'
					 	+'<span></span>'
				 	+'</a>'
    			+'</div>'
		/*	+'<nav class="mui-bar mui-bar-tab">'
			+'<a href="'+WapSiteUrl+'/index.html" class="mui-tab-item1">'
			+'<span style="margin: -2px 0 2px 0;" class="mui-icon"><img style="width: 20px;" src="images/index_112.jpg"></span>'
			+'<span class="mui-tab-label">首页</span>'
			+'</a>'
			+'<a href="'+WapSiteUrl+'/tmpl/product_first_categroy.html" class="mui-tab-item1" id="tabbar-with-fenlei">'
			+'<span class="mui-icon "><img style="width: 20px;" src="images/index_115.jpg"></span>'
			+'<span class="mui-tab-label">分类</span>'
			+'</a>'
			+'<a href="'+WapSiteUrl+'/tmpl/cart_list.html" class="mui-tab-item1" id="tabbar-shoppingcart">'
			+'<span class="mui-icon "><img style="width: 20px;" src="images/gouwuche239.png"><span class="mui-badge" style="display: none;">9</span></span>'
			+'<span id="gouwuche" class="mui-tab-label">购物车</span>'
			+'</a>'
			+'<a href="'+WapSiteUrl+'/tmpl/member/member.html?act=member" class="mui-tab-item1" id="tabbar-me-contact">'
			+'<span style="margin: -2px 0 2px 0;" class="mui-icon"><img style="width: 20px;" src="images/1_055.png"></span>'
			+'<span class="mui-tab-label">我</span>'
			+'</a>'
			+'</nav>'*/;
    //渲染页面
	var html = template.compile(tmpl);
	$("#header").html(html);
	$("#btn-opera").click(function (){
		$(".main-opera-pannel").toggle();
	});
	//当前页面
	if(headTitle == "商品分类"){
		$(".i-categroy").parent().addClass("current");
	}else if(headTitle == "购物车列表"){
		$(".i-cart").parent().addClass("current");
	}else if(headTitle == "我的商城"){
		$(".i-mine").parent().addClass("current");
	}
});